<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1.盒模型的宽度问题</title>
  <style>
    #box {
      width: 100px;
      padding: 10px;
      border: 1px solid #000;
      margin: 10px;
      box-sizing: border-box;
    }
  </style>
</head>

<body>
  <!-- 1.盒模型的宽度问题 -->
  box-sizing: 1.content-box 默认  width只是内容区的宽度
              2.border-box   width=content+padding+border

  <div id="box"></div>
  <script>
    console.log(document.getElementById('box').offsetWidth);
  </script>
</body>

</html>